package com.yanfan.common.sensitive.core;

import com.yanfan.common.utils.StringUtils;
import org.springframework.stereotype.Service;

/**
 * @author sc
 * @version JDK 8
 * @className SensitiveService
 * @date 2024/10/23
 * @description 脱敏服务, 默认管理员不过滤, 需自行根据业务重写实现
 */
@Service
public class SensitiveServiceImpl implements SensitiveService {

    /**
     * 是否脱敏
     */
    @Override
    public boolean isSensitive(String roleKey, String perms) {
        boolean roleExist = StringUtils.isNotBlank(roleKey);
        boolean permsExist = StringUtils.isNotBlank(perms);
        if (roleExist && permsExist) {
            return false;
        }
        return true;
    }

}
